package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.List;
/**
 * The persistent class for the "FUNCTION" database table.
 * 
 */
@Entity
@Table(name="\"FUNCTION\"")
@NamedQuery(name="Function.findAll", query="SELECT f FROM Function f")
public class Function implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="FUNCTION_FUNID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="FUNCTION_FUNID_GENERATOR")
	@Column(name="FUN_ID")
	private long funId;

	@Column(name="FUN_NAME")
	private String funName;

	//bi-directional many-to-one association to FunctionType
	@ManyToOne
	@JoinColumn(name="FUNCTION_ID")
	private FunctionType functionType;

	//bi-directional many-to-many association to Role
	@ManyToMany(mappedBy="functions")
	@JSONField(serialize=false)
	private List<Role> roles;

	public Function() {
	}

	public long getFunId() {
		return this.funId;
	}

	public void setFunId(long funId) {
		this.funId = funId;
	}

	public String getFunName() {
		return this.funName;
	}

	public void setFunName(String funName) {
		this.funName = funName;
	}

	public FunctionType getFunctionType() {
		return this.functionType;
	}

	public void setFunctionType(FunctionType functionType) {
		this.functionType = functionType;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}